package File_;

import org.junit.Test;

import java.io.File;
import java.io.IOException;

public class File_ {
    public static void main(String[] args) {

    }
 /* @Test
    public void file(){
        String filepath="d:\\next.txt";
        File file=new File(filepath);
        try {
            file.createNewFile();
            System.out.println("成功");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }*/
    @Test
    public void f(){
        File parentpath=new File("d:\\");
        String filename="next2.txt";
        File file=new File(parentpath,filename);
        try {
            file.createNewFile();
            System.out.println("成功2");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
   /* @Test
    public void f(){
        String parentpath="d:\\";
        String filename="next3.txt";
        File file=new File(parentpath,filename);
        try {
            file.createNewFile();
            System.out.println("成功3");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }*/
    /*@Test
    public void f2(){
        String filepath="d:\\next3.txt";
        File file=new File(filepath);
        if (file.exists()){
            if (file.delete()) {
                System.out.println("删除成功");
            }
        }else {
            System.out.println("未找到");
        }
    }*/
}
